package com.csu54sher.basereservation.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author csu54sher
 * @since 2025-10-19
 */
@Getter
@Setter
@TableName("image")
public class Image extends Model<Image> {

    private static final long serialVersionUID = 1L;

    /**
     * 图片ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Integer id;

    /**
     * 图片的地址
     */
    @TableField("image_url")
    private String imageUrl;

    /**
     * 表明图片是属于基地图片还是预约记录提交的图片
     */
    @TableField("type")
    private String type;

    /**
     * 图片属于的基地的ID(前提是类型是base)，可选
     */
    @TableField("base_id")
    private Integer baseId;

    /**
     * 预约ID，可选
     */
    @TableField("reservation_id")
    private Integer reservationId;

    /**
     * 创建的时间，数据库生成
     */
    @TableField("create_at")
    private LocalDateTime createAt;

    public static final String ID = "id";

    public static final String IMAGE_URL = "image_url";

    public static final String TYPE = "type";

    public static final String BASE_ID = "base_id";

    public static final String RESERVATION_ID = "reservation_id";

    public static final String CREATE_AT = "create_at";

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
